<!DOCTYPE html>
<html>

	<head>
		<title>我的收藏</title>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<link rel="stylesheet" href="/js/bootstrap-4.1.1-dist/css/bootstrap.min.css">
		<script src="/js/jquery/jquery.min.js"></script>
		<script src="/js/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
		<script src="/js/plugins/jrender/jrender.min.js"></script>
		<link rel="stylesheet" href="/css/font/css/font-awesome.min.css" />
		<link rel="stylesheet" href="/css/reset.css" />
		<link rel="stylesheet" href="/css/message.css" />
	</head>

	<body>

		<div class="search-head">

			<div class="row nav-search">
				<div class="col-2">
				<a href="/mine/profiles.html">
					<span><i class="fa fa-chevron-left fa-2x" style="color: white"></i></span>
				</a>
				</div>
				<div class="col" style="color: 	#FFB6C1">
					<span>我的收藏</span>
				</div>
				<div class="col"></div>
			</div>
		</div>

		<div id="countsDiv">
			<ul class="list-group">
				<a  href="/mine/collect/strategyCollect.html" >
					<li class="list-group-item d-flex justify-content-between align-items-center" style="background-color: 	#f2ade7">
						<div class="item" >
							<span><i class="fa " ></i></span>
							<span>我收藏的攻略~</span>
							<span class="badge badge-danger badge-pill" id="praiseMeCount"></span>
						</div>
						<i class="fa fa-chevron-right"></i>
					</li>
				</a>

				<a href="/mine/collect/travelCollect.html">
					<li class="list-group-item d-flex justify-content-between align-items-center" style="background-color: #dcccfc">
						<div class="item">
							<span><i class="fa " ></i></span>
							<span>我收藏的游记~</span>
							<span class="badge badge-danger badge-pill" id="aitaMeCount"></span>
						</div>
						<i class="fa fa-chevron-right"></i>
					</li>
				</a>
				<a href="/mine/collect/newsPagelCollect.html">
					<li class="list-group-item d-flex justify-content-between align-items-center" style="background-color: #f2ade7">
						<div class="item">
							<span><i class="fa " ></i>	</span>
							<span>我收藏的日报~</span>
							<span class="badge badge-danger badge-pill"  id="commentMeCount"></span>
						</div>
						<i class="fa fa-chevron-right"></i>
					</li>
				</a>
			</ul>
		</div>
	</body>
<script type="text/javascript">
    var user;
    function runEvery10Sec() {
        //setTimeout( runEvery10Sec, 1000*10);
        user = JSON.parse(sessionStorage.getItem('user'));
        $.get("/messages/"+user.id+"/"+0+"/counts",function (data) {
            $.each(data,function (index, ele) {
                if(ele.praiseMeCount > 0){
            		$("#praiseMeCount").html(ele.praiseMeCount);
				}
				if(ele.aitaMeCount>0){
            		$("#aitaMeCount").html(ele.aitaMeCount);
				}
				if(ele.privateMeCount>0){
            		$("#privateMeCount").html(ele.privateMeCount);
				}
                if(ele.systemMeCount>0){
                    $("#systemMeCount").html(ele.systemMeCount);
				}
                if(ele.commentMeCount>0){
                    $("#commentMeCount").html(ele.commentMeCount);
				}
            });
        });
    }
    runEvery10Sec();
</script>
</html>